<!--
 * @描述: 
 * @作者: 约訂
 * @Date: 2024-06-12 10:09:34
 * @LastEditTime: 2024-06-21 10:01:54
 * @修改人员: 约訂
-->
<template>
  <div id="app">
    <!-- <keep-alive>
      <router-view v-if="$route.meta.keepAlive" />
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive" /> -->
    <router-view />
  </div>
</template>

<script>
import color from "@/utils/color";
export default {
  name: "app",
  methods: {
    //App.vue
  },
  mounted() {
    // if (this._isMobile()) {s
    //   // alert("手机端");
    //    this.$router.push("/");
    // } else {
    //   // alert("pc端");
    //    this.$router.push("/");
    // }
  },

  computed: {
    defaultTheme() {
      return this.$store.state.settings.theme;
    }
  },
  watch: {
    defaultTheme: {
      handler(nval, oval) {
        document.documentElement.style.setProperty("--color-primary", nval);
        document.documentElement.style.setProperty(
          "--color-primary-3",
          color.lighten(nval, 0.3)
        );
        document.documentElement.style.setProperty(
          "--color-primary-6",
          color.lighten(nval, 0.6)
        );
        document.documentElement.style.setProperty(
          "--color-primary-bg",
          color.lighten(nval, 0.9)
        );
      },
      immediate: true
    }
  }
};
</script>
<style lang="css" src="./assets/icons/iconFont/iconfont.css"></style>
<style lang="scss" src="./assets/styles/variables.scss"></style>
